import { createStore, applyMiddleware, combineReducers } from 'redux'
import thunkMiddleware from 'redux-thunk'
import createLogger from 'redux-logger'
import rootReducer from './reducers'

const logger = createLogger();
const createStoreWithMiddle = applyMiddleware(
    thunkMiddleware,
    logger
)(createStore)

export default function configureStore(initialState) {
    return createStoreWithMiddle(rootReducer, initialState);
}

